|
The Ford–Fulkerson method or Ford–Fulkerson algorithm (FFA) is an algorithm that computes the maximum flow in a flow network. It is called a "method" instead of an "algorithm" as the approach to finding augmenting paths in a residual graph is not fully specified or it is specified in several implementations with different running times. It was published in 1956 by L. R. Ford, Jr. and D. R. Fulkerson. The name "Ford–Fulkerson" is often also used for the Edmonds–Karp algorithm, which is a specialization of Ford–Fulkerson. The idea behind the algorithm is as follows: as long as there is a path from the source (start node) to the sink (end node), with available capacity on all edges in the path, we send flow along one of the paths. Then we find another path, and so on. A path with available capacity is called an augmenting path. ==Algorithm== Let be a graph, and for each edge from to , let be the capacity and be the flow. We want to find the maximum flow from the source to the sink . After every step in the algorithm the following is maintained: : f(u,w) = 0 || That is, unless is or . The net flow to a node is zero, except for the source, which "produces" flow, and the sink, which "consumes" flow. |- | Value(f): || || That is, the flow leaving from must be equal to the flow arriving at . |- |} This means that the flow through the network is a ''legal flow'' after each round in the algorithm. We define the residual network to be the network with capacity and no flow. Notice that it can happen that a flow from to is allowed in the residual network, though disallowed in the original network: if and then . Algorithm Ford–Fulkerson :Inputs Given a Network with flow capacity , a source node , and a sink node :Output Compute a flow from to of maximum value :# for all edges :# While there is a path from to in , such that for all edges : :## Find :## For each edge :### (''Send flow along the path'') :### (''The flow might be "returned" later'') The path in step 2 can be found with for example a breadth-first search or a depth-first search in . If you use the former, the algorithm is called Edmonds–Karp. When no more paths in step 2 can be found, will not be able to reach in the residual network. If is the set of nodes reachable by in the residual network, then the total capacity in the original network of edges from to the remainder of is on the one hand equal to the total flow we found from to , and on the other hand serves as an upper bound for all such flows. This proves that the flow we found is maximal. See also Max-flow Min-cut theorem. If the graph has multiple sources and sinks, we act as follows: Suppose that and . Add a new source with an edge from to every node , with capacity . And add a new sink with an edge from every node to , with capacity . Then apply the Ford–Fulkerson algorithm. Also, if a node has capacity constraint , we replace this node with two nodes , and an edge , with capacity . Then apply the Ford–Fulkerson algorithm. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Ford–Fulkerson algorithm」の詳細全文を読む スポンサード リンク
|